package com.weipai.springboot.module.mapper;

import com.weipai.springboot.model.Inventory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

/**
 * 库存
 */
public interface InventoryMapper {
    int deleteByPrimaryKey(Long inventoryId);

    int insert(Inventory record);

    int insertSelective(Inventory record);

    Inventory selectByPrimaryKey(Long inventoryId);

    int updateByPrimaryKeySelective(Inventory record);

    int updateByPrimaryKey(Inventory record);

    Map<String,Object> getStorageGoodsNum(@Param("storageId") String storageId, @Param("skuNumber") String skuNumber);

    @Update("update c_inventory set goods_number=#{allNum} where inventory_id=#{inventoryId}")
    int updateGoodsNumber(@Param("inventoryId") String inventoryId, @Param("allNum") int allNum);
}